package com.testmanager.testmananger.zyyc.interTest.dto;

import com.alibaba.fastjson.JSONObject;
import com.testmanager.testmananger.foundation.dto.PageableDto;
import com.testmanager.testmananger.zyyc.interTest.constant.YCProjectStatus;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.ArrayList;

/**
 * @author hesencun
 * @date: 2021/7/1 2:45 PM
 */
@Data
@Accessors(chain = true)
public class CaseDto {

    private long id;

    private long no;

    private long projectNo;
    private String caseName;
    private String caseDescripe;
    private String methodName;
    private String preMethodName;
    private String author;


    public static void main(String[] args) {
        CaseDto caseDto = new CaseDto();
        caseDto.setCaseDescripe("dfdf")
                .setCaseName("dfdf")
                .setId(2323)
                .setMethodName("dfdf")
                .setNo(11)
                .setProjectNo(10)
                .setPreMethodName("dfdfdf");

        YCProjectDto ycProjectDto = new YCProjectDto();
        ycProjectDto.setId(1)
                .setModuleName("dfdf")
                .setNo(434)
                .setParentNo(2)
                .setProjectName("dfdf")
                .setStatus(1);

        CaseTestResultDto caseTestResultDto = new CaseTestResultDto();
        caseTestResultDto.setCaseName("dff")
                .setCaseNo(12)
                .setEndTime(LocalDateTime.now())
                .setId(12)
                .setNo(232)
                .setStartTime(LocalDateTime.now())
                .setStatus(1)
                .setSuiteName("df")
                .setSuiteNo(23)
                .setOutput("dfdfd")
                .setParameters("dfdf");


        SuiteResultDto suiteResultDto = new SuiteResultDto();
        suiteResultDto.setConutNum(12)
                .setEndTime(LocalDateTime.now())
                .setFail(12)
                .setId(12)
                .setNo(232)
                .setProjectNo(12)
                .setSkip(1)
                .setStartTime(LocalDateTime.now())
                .setStaus(1)
                .setSuccess(12)
                .setSuccessPercent(0.3)
                .setSuiteName("dfdf")
                .setTestName("dfdf");



        ArrayList<Object> objects = new ArrayList<>();
        objects.add(suiteResultDto);
        PageableDto var1 = new PageableDto();
        var1.setHasNext(true)
                .setHasPrevious(true)
                .setNextPage(3)
                .setPageNum(2)
                .setPageSize(10)
                .setPrePage(1)
                .setTotal(100)
                .setPages(10)
                .setList(objects);

        System.out.println(var1);

       // JSONObject.toJSONString(var1);
        System.out.println(JSONObject.toJSONString(var1));
    }


}
